LL RCC Macros

Common Write and read registers Macros

group RCC_LL_EM_WRITE_READ

Defines

LL_RCC_WRITE_REG ( reg , value ) STM32_WRITE_REG(RCC->reg, (value))

Write a value in RCC register.

Parameters :
  • reg – Register to be written

  • value – Value to be written in the register

LL_RCC_READ_REG ( reg ) STM32_READ_REG(RCC->reg)

Read a value in RCC register.

Parameters :
  • reg – Register to be read

Return values :

Register – value

Calculate frequencies

group RCC_LL_EM_CALC_FREQ

Defines

LL_RCC_CALC_HCLK_FREQ ( sysclk_freq , ahb_prescaler )

((sysclk_freq) >> \

AHBPrescTable[((ahb_prescaler)& RCC_CFGR2_HPRE) \

>> RCC_CFGR2_HPRE_Pos])


Helper macro to calculate the HCLK frequency.

Parameters :
Return values :

HCLK – clock frequency (in Hz)

LL_RCC_CALC_PCLK1_FREQ ( hclk_freq , apb1_prescaler )

((hclk_freq) >> \

(APBPrescTable[((apb1_prescaler)& \

RCC_CFGR2_PPRE1) >> RCC_CFGR2_PPRE1_Pos]))


Helper macro to calculate the PCLK1 frequency (ABP1).

Parameters :
Return values :

PCLK1 – clock frequency (in Hz)

LL_RCC_CALC_PCLK2_FREQ ( hclk_freq , apb2_prescaler )

((hclk_freq) >> \

(APBPrescTable[((apb2_prescaler)& \

RCC_CFGR2_PPRE2) >> RCC_CFGR2_PPRE2_Pos]))


Helper macro to calculate the PCLK2 frequency (ABP2).

Parameters :
Return values :

PCLK2 – clock frequency (in Hz)

LL_RCC_CALC_PCLK3_FREQ ( hclk_freq , apb3_prescaler )

((hclk_freq) >> \

(APBPrescTable[((apb3_prescaler)& \

RCC_CFGR2_PPRE3) >> RCC_CFGR2_PPRE3_Pos]))


Helper macro to calculate the PCLK3 frequency (ABP3).

Parameters :
Return values :

PCLK3 – clock frequency (in Hz)